Hệ thống hiệu sách thương mại điện tử

1 <?php
2
3 include
"dbconnect.php";
4
5
6 if
(isset($_POST['submit']))
7 {
8    
if($_POST['submit']=="register")
9      {
10         $username=$_POST[
'register_username'];
11         $password=$_POST[
'register_password'];
12         $query=
"select * from users where UserName = '$username'";
13         $result=mysqli_query($con,$query) or die(mysql_error);
14         
if(mysqli_num_rows($result)>0)
15         {
16               header(
"Location: index.php?register=" . "Username is already taken...Use different username");
17         }
18         
else
19         {
20           $query =
"INSERT INTO users VALUES ('$username','$password')";
21           $result=mysqli_query($con,$query);
22           header(
"Location: index.php?register=" . "Successfully Registered!!");
23         }
24     }
25 }
26
27 ?>


Gõ tìm kiếm nhanh...